package com.zjitc.controller;

import com.zjitc.obj.User;
import javax.naming.Name;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/3/19 16:40
 * @description:
 */
@Controller
public class UserController {

  @RequestMapping("/user")
  @ResponseBody
  public String param(
    @RequestParam(name = "id",required = false , defaultValue = "10") Integer id,String name){
      return "id="+id+"\tname="+name;
  }

  @RequestMapping("/u")
  @ResponseBody
  public String param1(User user){
    return user.toString();
  }
}
